package com.hpxx.ylzswl.https;

import android.content.Context;

import com.hpxx.ylzswl.utils.ConstantsUtils;
import com.universal.frame.generalutils.SharedPreferencesUtil;

import java.util.HashMap;
import java.util.Map;

public class RequestParams {

    public String TAG = "RequestParams";

    /***
     * 登录ID
     */
    public String userId = "";

    /**
     * 用户token
     */
    public String token;

    private Context context;

    public static int limit = 20;

    public static String merchantCode = "10000";


    public RequestParams(Context context) {
        super();
        if (SharedPreferencesUtil.getBoolean(context, ConstantsUtils.IS_LOGIN, false)) {
            userId = SharedPreferencesUtil.getString(context, ConstantsUtils.USER_ID);
        }
    }

    /**
     * 通用参数请求
     */
    public Map<String, String> getParams() {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        return params;
    }

    /**
     * 红点请求
     */
    public Map<String, String> getNoticeRedParams(int userType) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        params.put("userType", userType + "");
        return params;
    }

    /***
     * 登录
     *
     * @param pwd 密码
     * @return
     */
    public Map<String, String> getLoginParams(String tel, String pwd, int userType) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("tel", tel);
        params.put("pwd", pwd);
        params.put("userType", userType + "");
        return params;
    }


    /**
     * 获取验证码
     *
     * @param tel 电话
     * @return
     */
    public Map<String, String> getCodeParams(String tel) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("tel", tel);

        return params;
    }


    /**
     * 忘记密码
     *
     * @param tel     电话
     * @param captcha 验证码
     * @return
     */
    public Map<String, String> getForgetPswParams(String tel, String newPwd, String captcha, int userType) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("tel", tel);
        params.put("captcha", captcha);
        params.put("newPwd", newPwd);
        params.put("userType", userType + "");
        return params;
    }


    /**
     * 再线咨询
     *
     * @param orderId
     * @param pageIndex
     * @return
     */
    public Map<String, String> getConsParams(String orderId, int pageIndex) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("orderId", orderId);
        params.put("limit", limit + "");
        params.put("pageIndex", pageIndex + "");
        return params;
    }

    /**
     * 订单列表
     * userId	string	是	用户id	49d94b3e46da4b79930db72c0dd21ca7
     * userType	string	是	用户类型（1 医生 2患者 3物流 4销售 )	1
     * tabType	string	是	订单分类（ 1待接单 2已接单 3已完成）	1
     * limit	string	是	每页大小	10
     * pageIndex	string	是	页码	1
     * sn	string	是	订单号
     *
     * @return
     */
    public Map<String, String> getOrderListParams(int userType, String tabType, int pageIndex, String sn) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        params.put("limit", limit + "");
        params.put("pageIndex", pageIndex + "");
        params.put("userType", userType + "");
        params.put("tabType", tabType);
        params.put("sn", sn);
        return params;
    }

    //    订单详情
    public Map<String, String> getOrderDetailParams(int userType, String orderId) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("orderId", orderId);
        params.put("userType", userType + "");
        return params;
    }

    /**
     * 修改个人信息
     *
     * @param logisticRealname
     * @param logisticBirthday
     * @return
     */
    public Map<String, String> getUpdatePersonalParams(String logisticRealname, String logisticBirthday, String logisticSex) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("logisticId", userId);
        params.put("logisticRealname", logisticRealname);
        params.put("logisticBirthday", logisticBirthday);
        params.put("logisticSex", logisticSex);
        return params;
    }

    /**
     * 修改个人信息
     *
     * @param oldPwd
     * @param newPwd
     * @return
     */
    public Map<String, String> getUpdatePwdParams(String oldPwd, String newPwd, int userType) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        params.put("oldPwd", oldPwd);
        params.put("newPwd", newPwd);
        params.put("userType", userType + "");
        return params;
    }

    /**
     * 修改手机号码
     *
     * @param tel
     * @param captcha
     * @return
     */
    public Map<String, String> getUpdatePhoneParams(String tel, String captcha, int userType) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        params.put("tel", tel);
        params.put("captcha", captcha);
        params.put("userType", userType + "");
        return params;
    }

    /**
     * 意见反馈
     *
     * @param tel
     * @param content
     * @return
     */
    public Map<String, String> getUserFeedParams(String tel, String content, int userType) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        params.put("tel", tel);
        params.put("content", content);
        params.put("userType", userType + "");
        return params;
    }

    /**
     * 消息中心列表
     *
     * @param pageIndex
     * @param userType
     * @return
     */
    public Map<String, String> getMessageListParams(int pageIndex, int userType) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        params.put("limit", limit + "");
        params.put("pageIndex", pageIndex + "");
        params.put("userType", userType + "");
        return params;
    }

    /**
     * 消息中心红点消失
     *
     * @param noticeId
     * @return
     */
    public Map<String, String> getMessageUpdataParams(String noticeId) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("noticeId", noticeId);
        return params;
    }

    /**
     * 接单
     *
     * @param orderId
     * @return
     */
    public Map<String, String> getReceiveOrderParams(String orderId, String orderNote) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("logisticId", userId);
        params.put("orderId", orderId);
        params.put("orderNote", orderNote);
        return params;
    }

    /**
     * 检查项目
     *
     * @param itemName
     * @return
     */
    public Map<String, String> getOrderItemParams(String itemName,int pageIndex) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("itemName", itemName);
        params.put("limit", limit+"");
        params.put("pageIndex", pageIndex+"");
        return params;
    }

    /**
     * 输入患者信息
     *
     * @param orderId
     * @return
     */
    public Map<String, String> getHzInfoParams(String orderId, String bloodNum, String patientTel, String orderAmount) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("orderId", orderId);
        params.put("bloodNum", bloodNum);
        params.put("patientTel", patientTel);
        params.put("orderAmount", orderAmount);
        return params;
    }

    /**
     * 上传申请单
     *
     * @param orderId
     * @return
     */
    public Map<String, String> getUploadApyImgParams(String orderId) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("orderId", orderId);
        return params;
    }

    /**
     * TAB订单红点
     *
     * @return
     * @ userId	string	是	用户id
     * userType	string	是	用户类型（1 医生 2患者 3物流 )
     * tabType	string	是 订单分类（ 1待接单 2已接单 3已完成）
     */
    public Map<String, String> getUploadTabParams() {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        params.put("userType", "3");
        params.put("tabType", "1");
        return params;
    }

    /**
     * 血样编号检查
     *
     * @return
     * @ userId	string	是	用户id
     * userType	string	是	用户类型（1 医生 2患者 3物流 )
     * tabType	string	是 订单分类（ 1待接单 2已接单 3已完成）
     */
    public Map<String, String> getBloodParams(String bloodNum) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("bloodNum", bloodNum);
        return params;
    }

    /**
     * 版本更新
     *
     * @param
     * @return
     */
    public Map<String, String> getUpdateVersionParams(String appType, String version) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("versionType", 0 + "");
        params.put("appType", appType);
        params.put("version", version);
        return params;
    }
    /**
     * 个人信息
     *
     * @param
     * @return
     */
    public Map<String, String> getPersonalParams() {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userId", userId);
        params.put("userType", "3");
        return params;
    }
}
